from django.http import HttpResponse
from django.shortcuts import render
from django.shortcuts import redirect
from django.urls import reverse

# Create your views here.
from django.views import View


def index(request):
    return HttpResponse('OK')


def redirect_view(request):
    return redirect(reverse('auser:index'))


def request_data(request):


    return HttpResponse(content='OOOOOKKKK', content_type='text/html', status=500)


def set_cookie(request):
    response = HttpResponse('设置cookie需要使用响应对象')
    # response.set_cookie('name','itheima')
    values = request.COOKIES['name']
    print(values)
    return response


def set_session(request):
    request.session['name']= 'zhangsna'
    request.session.get('name')
    return HttpResponse('set_session')


class RegisterView(View):
    def get(self,request):
        pass
